<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>双重循环打印⭐</title>
    <script>
        var s = prompt('请输入打印几行⭐');
        var str = '';
        for (var i = 1; i <= s; i++) {
            for (var j = 1; j <= s; j++) {
                str += '⭐';
            }
            str += '\n';
        }

        alert(str);
        console.log(str);
    </script>
</head>

<body>

</body>

</html>